From b0a5091ac9bff84587094af147ade3d354beea0c Mon Sep 17 00:00:00 2001 From: Andres Lagar-Cavilla Date: Thu, 12 Jan 2012 10:52:30 +0000 Subject: [PATCH] x86/mm: Disable paging_prep The only way to page-in a page is now the safe paging_load domctl. (Unless the page was never paged out in the first place) Signed-off-by: Andres Lagar-Cavilla Acked-by: Tim Deegan Committed-by: Tim Deegan --- xen/arch/x86/mm/p2m.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index e37a1fe0f1..6a1cad08bc 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -989,6 +989,10 @@ int p2m_mem_paging_prep(struct domain *d, unsigned long gfn, uint64_t buffer) /* Allocate a page if the gfn does not have one yet */ if ( !mfn_valid(mfn) ) { + /* If the user did not provide a buffer, we disallow */ + ret = -EINVAL; + if ( unlikely(user_ptr == NULL) ) + goto out; /* Get a free page */ ret = -ENOMEM; page = alloc_domheap_page(p2m->domain, 0); -- 2.30.2